package com.xps.and.yuntong.Data.bean1;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

/**
 * Created by Administrator on 2018/2/1.
 */

public class OrderList {
    @Override
    public String toString() {
        return "OrderList{" +
                "return_code='" + return_code + '\'' +
                ", return_msg='" + return_msg + '\'' +
                ", return_body=" + return_body +
                '}';
    }

    /**
     * return_code : SUCCESS
     * return_msg : 查询成功
     * return_body : [{"order_id":"1677","order_sn":"H124897683222034","order_state":"5","order_type":"1","start_time":"1517210324","end_time":"1517294617","begin_address":"天津市西青区环岛西路","end_address":"实验中学","is_closed":"0"}]
     */

    private String return_code;
    private String return_msg;
    private List<ReturnBodyBean> return_body;

    public static OrderList objectFromData(String str) {

        return new Gson().fromJson(str, OrderList.class);
    }

    public static OrderList objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), OrderList.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public String getReturn_code() {
        return return_code;
    }

    public void setReturn_code(String return_code) {
        this.return_code = return_code;
    }

    public String getReturn_msg() {
        return return_msg;
    }

    public void setReturn_msg(String return_msg) {
        this.return_msg = return_msg;
    }

    public List<ReturnBodyBean> getReturn_body() {
        return return_body;
    }

    public void setReturn_body(List<ReturnBodyBean> return_body) {
        this.return_body = return_body;
    }

    public static class ReturnBodyBean {
        @Override
        public String toString() {
            return "ReturnBodyBean{" +
                    "order_id='" + order_id + '\'' +
                    ", order_sn='" + order_sn + '\'' +
                    ", order_state='" + order_state + '\'' +
                    ", order_type='" + order_type + '\'' +
                    ", start_time='" + start_time + '\'' +
                    ", end_time='" + end_time + '\'' +
                    ", begin_address='" + begin_address + '\'' +
                    ", end_address='" + end_address + '\'' +
                    ", is_closed='" + is_closed + '\'' +
                    '}';
        }

        /**
         * order_id : 1677
         * order_sn : H124897683222034
         * order_state : 5
         * order_type : 1
         * start_time : 1517210324
         * end_time : 1517294617
         * begin_address : 天津市西青区环岛西路
         * end_address : 实验中学
         * is_closed : 0
         */

        private String order_id;
        private String order_sn;
        private String order_state;
        private String order_type;
        private String start_time;
        private String end_time;
        private String begin_address;
        private String end_address;
        private String is_closed;

        public static ReturnBodyBean objectFromData(String str) {

            return new Gson().fromJson(str, ReturnBodyBean.class);
        }

        public static ReturnBodyBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), ReturnBodyBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public String getOrder_id() {
            return order_id;
        }

        public void setOrder_id(String order_id) {
            this.order_id = order_id;
        }

        public String getOrder_sn() {
            return order_sn;
        }

        public void setOrder_sn(String order_sn) {
            this.order_sn = order_sn;
        }

        public String getOrder_state() {
            return order_state;
        }

        public void setOrder_state(String order_state) {
            this.order_state = order_state;
        }

        public String getOrder_type() {
            return order_type;
        }

        public void setOrder_type(String order_type) {
            this.order_type = order_type;
        }

        public String getStart_time() {
            return start_time;
        }

        public void setStart_time(String start_time) {
            this.start_time = start_time;
        }

        public String getEnd_time() {
            return end_time;
        }

        public void setEnd_time(String end_time) {
            this.end_time = end_time;
        }

        public String getBegin_address() {
            return begin_address;
        }

        public void setBegin_address(String begin_address) {
            this.begin_address = begin_address;
        }

        public String getEnd_address() {
            return end_address;
        }

        public void setEnd_address(String end_address) {
            this.end_address = end_address;
        }

        public String getIs_closed() {
            return is_closed;
        }

        public void setIs_closed(String is_closed) {
            this.is_closed = is_closed;
        }
    }
}
